﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace JasLib.Interop.Win32
{
    /// <summary>
    /// Warnings are positive values, errors are negative values.
    /// </summary>
    public enum JET_ERR : int
    {
        JET_errSuccess = 0, /// Successful Operation 

        JET_wrnNyi = -1, /// Function Not Yet Implemented 

        JET_errRfsFailure = -100, /// Resource Failure Simulator failure 
        JET_errRfsNotArmed = -101, /// Resource Failure Simulator not initialized 
        JET_errFileClose = -102, /// Could not close file 
        JET_errOutOfThreads = -103, /// Could not start thread 
        JET_errTooManyIO = -105, /// System busy due to too many IOs 
        JET_errTaskDropped = -106, /// A requested async task could not be executed 
        JET_errInternalError = -107, /// Fatal internal error 

        JET_errDatabaseBufferDependenciesCorrupted = -255, /// Buffer dependencies improperly set. Recovery failure 
        JET_wrnRemainingVersions = 321, /// The version store is still active 
        JET_errPreviousVersion = -322, /// Version already existed. Recovery failure 
        JET_errPageBoundary = -323, /// Reached Page Boundary 
        JET_errKeyBoundary = -324, /// Reached Key Boundary 
        JET_errBadPageLink = -327, /// Database corrupted 
        JET_errBadBookmark = -328, /// Bookmark has no corresponding address in database 
        JET_errNTSystemCallFailed = -334,  // A call to the operating system failed
        JET_errBadParentPageLink = -338,  // Database corrupted
        JET_errSPAvailExtCacheOutOfSync = -340,/// AvailExt cache doesn't match btree
        JET_errSPAvailExtCorrupted = -341,/// AvailExt space tree is corrupt
        JET_errSPAvailExtCacheOutOfMemory = -342,/// Out of memory allocating an AvailExt cache node
        JET_errSPOwnExtCorrupted = -343,/// OwnExt space tree is corrupt
        JET_errDbTimeCorrupted = -344,/// Dbtime on current page is greater than global database dbtime
        JET_wrnUniqueKey = 345,/// seek on non-unique index yielded a unique key
        JET_errKeyTruncated = -346,/// key truncated on index that disallows key truncation
        JET_wrnSeparateLongValue = 406, /// Column is a separated long-value 
        JET_wrnRecordFoundGreater = JET_wrnSeekNotEqual,
        JET_wrnRecordFoundLess = JET_wrnSeekNotEqual,
        JET_errColumnIllegalNull = JET_errNullInvalid,
        JET_errKeyTooBig = -408, /// Key is too large 
        JET_errInvalidLoggedOperation = -500, /// Logged operation cannot be redone 
        JET_errLogFileCorrupt = -501, /// Log file is corrupt 
        JET_errNoBackupDirectory = -503, /// No backup directory given 
        JET_errBackupDirectoryNotEmpty = -504, /// The backup directory is not emtpy 
        JET_errBackupInProgress = -505, /// Backup is active already 
        JET_errRestoreInProgress = -506, /// Restore in progress 
        JET_errMissingPreviousLogFile = -509, /// Missing the log file for check point 
        JET_errLogWriteFail = -510, /// Failure writing to log file 
        JET_errLogDisabledDueToRecoveryFailure = -511, /// Try to log something after recovery faild 
        JET_errCannotLogDuringRecoveryRedo = -512, /// Try to log something during recovery redo 
        JET_errLogGenerationMismatch = -513, /// Name of logfile does not match internal generation number 
        JET_errBadLogVersion = -514, /// Version of log file is not compatible with Jet version 
        JET_errInvalidLogSequence = -515, /// Timestamp in next log does not match expected 
        JET_errLoggingDisabled = -516, /// Log is not active 
        JET_errLogBufferTooSmall = -517, /// Log buffer is too small for recovery 
        JET_errLogSequenceEnd = -519, /// Maximum log file number exceeded 
        JET_errNoBackup = -520, /// No backup in progress 
        JET_errInvalidBackupSequence = -521, /// Backup call out of sequence 
        JET_errBackupNotAllowedYet = -523, /// Cannot do backup now 
        JET_errDeleteBackupFileFail = -524, /// Could not delete backup file 
        JET_errMakeBackupDirectoryFail = -525, /// Could not make backup temp directory 
        JET_errInvalidBackup = -526, /// Cannot perform incremental backup when circular logging enabled 
        JET_errRecoveredWithErrors = -527, /// Restored with errors 
        JET_errMissingLogFile = -528, /// Current log file missing 
        JET_errLogDiskFull = -529, /// Log disk full 
        JET_errBadLogSignature = -530, /// Bad signature for a log file 
        JET_errBadDbSignature = -531, /// Bad signature for a db file 
        JET_errBadCheckpointSignature = -532, /// Bad signature for a checkpoint file 
        JET_errCheckpointCorrupt = -533, /// Checkpoint file not found or corrupt 
        JET_errMissingPatchPage = -534, /// Patch file page not found during recovery 
        JET_errBadPatchPage = -535, /// Patch file page is not valid 
        JET_errRedoAbruptEnded = -536, /// Redo abruptly ended due to sudden failure in reading logs from log file 
        JET_errBadSLVSignature = -537, /// Signature in SLV file does not agree with database 
        JET_errPatchFileMissing = -538, /// Hard restore detected that patch file is missing from backup set 
        JET_errDatabaseLogSetMismatch = -539, /// Database does not belong with the current set of log files 
        JET_errDatabaseStreamingFileMismatch = -540, /// Database and streaming file do not match each other 
        JET_errLogFileSizeMismatch = -541, /// actual log file size does not match JET_paramLogFileSize 
        JET_errCheckpointFileNotFound = -542, /// Could not locate checkpoint file 
        JET_errRequiredLogFilesMissing = -543, /// The required log files for recovery is missing. 
        JET_errSoftRecoveryOnBackupDatabase = -544, /// Soft recovery is intended on a backup database. Restore should be used instead 
        JET_errLogFileSizeMismatchDatabasesConsistent = -545, /// databases have been recovered, but the log file size used during recovery does not match JET_paramLogFileSize 
        JET_errLogSectorSizeMismatch = -546, /// the log file sector size does not match the current volume's sector size 
        JET_errLogSectorSizeMismatchDatabasesConsistent = -547, /// databases have been recovered, but the log file sector size (used during recovery) does not match the current volume's sector size 
        JET_errLogSequenceEndDatabasesConsistent = -548, /// databases have been recovered, but all possible log generations in the current sequence are used; delete all log files and the checkpoint file and backup the databases before continuing 

        JET_errStreamingDataNotLogged = -549, /// Illegal attempt to replay a streaming file operation where the data wasn't logged. Probably caused by an attempt to roll-forward with circular logging enabled 

        JET_errDatabaseDirtyShutdown = -550, /// Database was not shutdown cleanly. Recovery must first be run to properly complete database operations for the previous shutdown. 
        JET_errConsistentTimeMismatch = -551, /// Database last consistent time unmatched 
        JET_errDatabasePatchFileMismatch = -552, /// Patch file is not generated from this backup 
        JET_errEndingRestoreLogTooLow = -553, /// The starting log number too low for the restore 
        JET_errStartingRestoreLogTooHigh = -554, /// The starting log number too high for the restore 
        JET_errGivenLogFileHasBadSignature = -555, /// Restore log file has bad signature 
        JET_errGivenLogFileIsNotContiguous = -556, /// Restore log file is not contiguous 
        JET_errMissingRestoreLogFiles = -557, /// Some restore log files are missing 
        JET_wrnExistingLogFileHasBadSignature = 558, /// Existing log file has bad signature 
        JET_wrnExistingLogFileIsNotContiguous = 559, /// Existing log file is not contiguous 
        JET_errMissingFullBackup = -560, /// The database miss a previous full backup befor incremental backup 
        JET_errBadBackupDatabaseSize = -561, /// The backup database size is not in 4k 
        JET_errDatabaseAlreadyUpgraded = -562, /// Attempted to upgrade a database that is already current 
        JET_errDatabaseIncompleteUpgrade = -563, /// Attempted to use a database which was only partially converted to the current format -- must restore from backup 
        JET_wrnSkipThisRecord = 564, /// INTERNAL ERROR 
        JET_errMissingCurrentLogFiles = -565, /// Some current log files are missing for continuous restore 

        JET_errDbTimeTooOld = -566, /// dbtime on page smaller than dbtimeBefore in record 
        JET_errDbTimeTooNew = -567, /// dbtime on page in advance of the dbtimeBefore in record 
        JET_errMissingFileToBackup = -569, /// Some log or patch files are missing during backup 

        JET_errLogTornWriteDuringHardRestore = -570, /// torn-write was detected in a backup set during hard restore 
        JET_errLogTornWriteDuringHardRecovery = -571, /// torn-write was detected during hard recovery (log was not part of a backup set) 
        JET_errLogCorruptDuringHardRestore = -573, /// corruption was detected in a backup set during hard restore 
        JET_errLogCorruptDuringHardRecovery = -574, /// corruption was detected during hard recovery (log was not part of a backup set) 

        JET_errMustDisableLoggingForDbUpgrade = -575, /// Cannot have logging enabled while attempting to upgrade db 

        JET_errBadRestoreTargetInstance = -577, /// TargetInstance specified for restore is not found or log files don't match 
        JET_wrnTargetInstanceRunning = 578, /// TargetInstance specified for restore is running 

        JET_errRecoveredWithoutUndo = -579, /// Soft recovery successfully replayed all operations, but the Undo phase of recovery was skipped 

        JET_errDatabasesNotFromSameSnapshot = -580, /// Databases to be restored are not from the same shadow copy backup 
        JET_errSoftRecoveryOnSnapshot = -581, /// Soft recovery on a database from a shadow copy backup set 
        JET_errCommittedLogFilesMissing = -582, /// One or more logs that were committed to this database, are missing.  These log files are required to maintain durable ACID semantics, but not required to maintain consistency if the JET_bitReplayIgnoreLostLogs bit is specified during recovery. 
        JET_errSectorSizeNotSupported = -583, /// The physical sector size reported by the disk subsystem, is unsupported by ESE for a specific file type. 
        JET_errRecoveredWithoutUndoDatabasesConsistent = -584, /// Soft recovery successfully replayed all operations and intended to skip the Undo phase of recovery, but the Undo phase was not required 
        JET_wrnCommittedLogFilesLost = 585, /// One or more logs that were committed to this database, were not recovered.  The database is still clean/consistent, as though the lost log's transactions were committed lazily (and lost). 
        JET_errCommittedLogFileCorrupt = -586, /// One or more logs were found to be corrupt during recovery.  These log files are required to maintain durable ACID semantics, but not required to maintain consistency if the JET_bitIgnoreLostLogs bit and JET_paramDeleteOutOfRangeLogs is specified during recovery. 
        JET_wrnCommittedLogFilesRemoved = 587, /// One or more logs that were committed to this database, were no recovered.  The database is still clean/consistent, as though the corrupted log's transactions were committed lazily (and lost). 

        JET_wrnDatabaseRepaired = 595, /// Database corruption has been repaired 

        JET_errUnicodeTranslationBufferTooSmall = -601, /// Unicode translation buffer too small 
        JET_errUnicodeTranslationFail = -602, /// Unicode normalization failed 
        JET_errUnicodeNormalizationNotSupported = -603, /// OS does not provide support for Unicode normalisation (and no normalisation callback was specified) 

        JET_errExistingLogFileHasBadSignature = -610, /// Existing log file has bad signature 
        JET_errExistingLogFileIsNotContiguous = -611, /// Existing log file is not contiguous 

        JET_errLogReadVerifyFailure = -612, /// Checksum error in log file during backup 
        JET_errSLVReadVerifyFailure = -613, /// Checksum error in SLV file during backup 

        JET_errCheckpointDepthTooDeep = -614,///too many outstanding generations between checkpoint and current generation

        JET_errRestoreOfNonBackupDatabase = -615, ///hard recovery attempted on a database that wasn't a backup database
        JET_errLogFileNotCopied = -616, ///log truncation attempted but not all required logs were copied

        JET_errInvalidGrbit = -900, /// Invalid parameter 

        JET_errTermInProgress = -1000, /// Termination in progress 
        JET_errFeatureNotAvailable = -1001, /// API not supported 
        JET_errInvalidName = -1002, /// Invalid name 
        JET_errInvalidParameter = -1003, /// Invalid API parameter 
        JET_wrnColumnNull = 1004, /// Column is NULL-valued 
        JET_wrnBufferTruncated = 1006, /// Buffer too small for data 
        JET_wrnDatabaseAttached = 1007, /// Database is already attached 
        JET_errDatabaseFileReadOnly = -1008, /// Tried to attach a read-only database file for read/write operations 
        JET_wrnSortOverflow = 1009, /// Sort does not fit in memory 
        JET_errInvalidDatabaseId = -1010, /// Invalid database id 
        JET_errOutOfMemory = -1011, /// Out of Memory 
        JET_errOutOfDatabaseSpace = -1012, /// Maximum database size reached 
        JET_errOutOfCursors = -1013, /// Out of table cursors 
        JET_errOutOfBuffers = -1014, /// Out of database page buffers 
        JET_errTooManyIndexes = -1015, /// Too many indexes 
        JET_errTooManyKeys = -1016, /// Too many columns in an index 
        JET_errRecordDeleted = -1017, /// Record has been deleted 
        JET_errReadVerifyFailure = -1018, /// Checksum error on a database page 
        JET_errPageNotInitialized = -1019, /// Blank database page 
        JET_errOutOfFileHandles = -1020, /// Out of file handles 
        JET_errDiskReadVerificationFailure = -1021, /// The OS returned ERROR_CRC from file IO 
        JET_errDiskIO = -1022, /// Disk IO error 
        JET_errInvalidPath = -1023, /// Invalid file path 
        JET_errInvalidSystemPath = -1024, /// Invalid system path 
        JET_errInvalidLogDirectory = -1025, /// Invalid log directory 
        JET_errRecordTooBig = -1026, /// Record larger than maximum size 
        JET_errTooManyOpenDatabases = -1027, /// Too many open databases 
        JET_errInvalidDatabase = -1028, /// Not a database file 
        JET_errNotInitialized = -1029, /// Database engine not initialized 
        JET_errAlreadyInitialized = -1030, /// Database engine already initialized 
        JET_errInitInProgress = -1031, /// Database engine is being initialized 
        JET_errFileAccessDenied = -1032, /// Cannot access file, the file is locked or in use 
        JET_errBufferTooSmall = -1038, /// Buffer is too small 
        JET_wrnSeekNotEqual = 1039, /// Exact match not found during seek 
        JET_errTooManyColumns = -1040, /// Too many columns defined 
        JET_errContainerNotEmpty = -1043, /// Container is not empty 
        JET_errInvalidFilename = -1044, /// Filename is invalid 
        JET_errInvalidBookmark = -1045, /// Invalid bookmark 
        JET_errColumnInUse = -1046, /// Column used in an index 
        JET_errInvalidBufferSize = -1047, /// Data buffer doesn't match column size 
        JET_errColumnNotUpdatable = -1048, /// Cannot set column value 
        JET_errIndexInUse = -1051, /// Index is in use 
        JET_errLinkNotSupported = -1052, /// Link support unavailable 
        JET_errNullKeyDisallowed = -1053, /// Null keys are disallowed on index 
        JET_errNotInTransaction = -1054, /// Operation must be within a transaction 
        JET_wrnNoErrorInfo = 1055, /// No extended error information 
        JET_wrnNoIdleActivity = 1058, /// No idle activity occured 
        JET_errTooManyActiveUsers = -1059, /// Too many active database users 
        JET_errInvalidCountry = -1061, /// Invalid or unknown country code 
        JET_errInvalidLanguageId = -1062, /// Invalid or unknown language id 
        JET_errInvalidCodePage = -1063, /// Invalid or unknown code page 
        JET_errInvalidLCMapStringFlags = -1064, /// Invalid flags for LCMapString() 
        JET_errVersionStoreEntryTooBig = -1065, /// Attempted to create a version store entry (RCE) larger than a version bucket 
        JET_errVersionStoreOutOfMemoryAndCleanupTimedOut = -1066, /// Version store out of memory (and cleanup attempt failed to complete) 
        JET_wrnNoWriteLock = 1067, /// No write lock at transaction level 0 
        JET_wrnColumnSetNull = 1068, /// Column set to NULL-value 
        JET_errVersionStoreOutOfMemory = -1069, /// Version store out of memory (cleanup already attempted) 
        JET_errCannotIndex = -1071, /// Cannot index escrow column or SLV column 
        JET_errRecordNotDeleted = -1072, /// Record has not been deleted 
        JET_errTooManyMempoolEntries = -1073, /// Too many mempool entries requested 
        JET_errOutOfObjectIDs = -1074, /// Out of btree ObjectIDs (perform offline defrag to reclaim freed/unused ObjectIds) 
        JET_errOutOfLongValueIDs = -1075, /// Long-value ID counter has reached maximum value. (perform offline defrag to reclaim free/unused LongValueIDs) 
        JET_errOutOfAutoincrementValues = -1076, /// Auto-increment counter has reached maximum value (offline defrag WILL NOT be able to reclaim free/unused Auto-increment values). 
        JET_errOutOfDbtimeValues = -1077, /// Dbtime counter has reached maximum value (perform offline defrag to reclaim free/unused Dbtime values) 
        JET_errOutOfSequentialIndexValues = -1078, /// Sequential index counter has reached maximum value (perform offline defrag to reclaim free/unused SequentialIndex values) 

        JET_errRunningInOneInstanceMode = -1080, /// Multi-instance call with single-instance mode enabled 
        JET_errRunningInMultiInstanceMode = -1081, /// Single-instance call with multi-instance mode enabled 
        JET_errSystemParamsAlreadySet = -1082, /// Global system parameters have already been set 

        JET_errSystemPathInUse = -1083, /// System path already used by another database instance 
        JET_errLogFilePathInUse = -1084, /// Logfile path already used by another database instance 
        JET_errTempPathInUse = -1085, /// Temp path already used by another database instance 
        JET_errInstanceNameInUse = -1086, /// Instance Name already in use 

        JET_errInstanceUnavailable = -1090, /// This instance cannot be used because it encountered a fatal error 
        JET_errDatabaseUnavailable = -1091, /// This database cannot be used because it encountered a fatal error 
        JET_errInstanceUnavailableDueToFatalLogDiskFull = -1092, /// This instance cannot be used because it encountered a log-disk-full error performing an operation (likely transaction rollback) that could not tolerate failure 

        JET_errOutOfSessions = -1101, /// Out of sessions 
        JET_errWriteConflict = -1102, /// Write lock failed due to outstanding write lock 
        JET_errTransTooDeep = -1103, /// Transactions nested too deeply 
        JET_errInvalidSesid = -1104, /// Invalid session handle 
        JET_errWriteConflictPrimaryIndex = -1105, /// Update attempted on uncommitted primary index 
        JET_errInTransaction = -1108, /// Operation not allowed within a transaction 
        JET_errRollbackRequired = -1109, /// Must rollback current transaction -- cannot commit or begin a new one 
        JET_errTransReadOnly = -1110, /// Read-only transaction tried to modify the database 
        JET_errSessionWriteConflict = -1111, /// Attempt to replace the same record by two diffrerent cursors in the same session 

        JET_errRecordTooBigForBackwardCompatibility = -1112, /// record would be too big if represented in a database format from a previous version of Jet 
        JET_errCannotMaterializeForwardOnlySort = -1113, /// The temp table could not be created due to parameters that conflict with JET_bitTTForwardOnly 

        JET_errSesidTableIdMismatch = -1114, /// This session handle can't be used with this table id 
        JET_errInvalidInstance = -1115, /// Invalid instance handle 
        JET_errDirtyShutdown = -1116, /// The instance was shutdown successfully but all the attached databases were left in a dirty state by request via JET_bitTermDirty 


        JET_errDatabaseDuplicate = -1201, /// Database already exists 
        JET_errDatabaseInUse = -1202, /// Database in use 
        JET_errDatabaseNotFound = -1203, /// No such database 
        JET_errDatabaseInvalidName = -1204, /// Invalid database name 
        JET_errDatabaseInvalidPages = -1205, /// Invalid number of pages 
        JET_errDatabaseCorrupted = -1206, /// Non database file or corrupted db 
        JET_errDatabaseLocked = -1207, /// Database exclusively locked 
        JET_errCannotDisableVersioning = -1208, /// Cannot disable versioning for this database 
        JET_errInvalidDatabaseVersion = -1209, /// Database engine is incompatible with database 

        JET_errDatabase200Format = -1210, /// The database is in an older (200) format 
        JET_errDatabase400Format = -1211, /// The database is in an older (400) format 
        JET_errDatabase500Format = -1212, /// The database is in an older (500) format 

        JET_errPageSizeMismatch = -1213, /// The database page size does not match the engine 
        JET_errTooManyInstances = -1214, /// Cannot start any more database instances 
        JET_errDatabaseSharingViolation = -1215, /// A different database instance is using this database 
        JET_errAttachedDatabaseMismatch = -1216, /// An outstanding database attachment has been detected at the start or end of recovery, but database is missing or does not match attachment info 
        JET_errDatabaseInvalidPath = -1217, /// Specified path to database file is illegal 
        JET_errDatabaseIdInUse = -1218, /// A database is being assigned an id already in use 
        JET_errForceDetachNotAllowed = -1219, /// Force Detach allowed only after normal detach errored out 
        JET_errCatalogCorrupted = -1220, /// Corruption detected in catalog 
        JET_errPartiallyAttachedDB = -1221, /// Database is partially attached. Cannot complete attach operation 
        JET_errDatabaseSignInUse = -1222, /// Database with same signature in use 

        JET_errDatabaseCorruptedNoRepair = -1224, /// Corrupted db but repair not allowed 
        JET_errInvalidCreateDbVersion = -1225, /// recovery tried to replay a database creation, but the database was originally created with an incompatible (likely older) version of the database engine 

        JET_wrnTableEmpty = 1301, /// Opened an empty table 
        JET_errTableLocked = -1302, /// Table is exclusively locked 
        JET_errTableDuplicate = -1303, /// Table already exists 
        JET_errTableInUse = -1304, /// Table is in use, cannot lock 
        JET_errObjectNotFound = -1305, /// No such table or object 
        JET_errDensityInvalid = -1307, /// Bad file/index density 
        JET_errTableNotEmpty = -1308, /// Table is not empty 
        JET_errInvalidTableId = -1310, /// Invalid table id 
        JET_errTooManyOpenTables = -1311, /// Cannot open any more tables (cleanup already attempted) 
        JET_errIllegalOperation = -1312, /// Oper. not supported on table 
        JET_errTooManyOpenTablesAndCleanupTimedOut = -1313, /// Cannot open any more tables (cleanup attempt failed to complete) 
        JET_errObjectDuplicate = -1314, /// Table or object name in use 
        JET_errInvalidObject = -1316, /// Object is invalid for operation 
        JET_errCannotDeleteTempTable = -1317, /// Use CloseTable instead of DeleteTable to delete temp table 
        JET_errCannotDeleteSystemTable = -1318, /// Illegal attempt to delete a system table 
        JET_errCannotDeleteTemplateTable = -1319, /// Illegal attempt to delete a template table 
        JET_errExclusiveTableLockRequired = -1322, /// Must have exclusive lock on table. 
        JET_errFixedDDL = -1323, /// DDL operations prohibited on this table 
        JET_errFixedInheritedDDL = -1324, /// On a derived table, DDL operations are prohibited on inherited portion of DDL 
        JET_errCannotNestDDL = -1325, /// Nesting of hierarchical DDL is not currently supported. 
        JET_errDDLNotInheritable = -1326, /// Tried to inherit DDL from a table not marked as a template table. 
        JET_wrnTableInUseBySystem = 1327, /// System cleanup has a cursor open on the table 
        JET_errInvalidSettings = -1328, /// System parameters were set improperly 
        JET_errClientRequestToStopJetService = -1329, /// Client has requested stop service 
        JET_errCannotAddFixedVarColumnToDerivedTable = -1330, /// Template table was created with NoFixedVarColumnsInDerivedTables 
        JET_errIndexCantBuild = -1401, /// Index build failed 
        JET_errIndexHasPrimary = -1402, /// Primary index already defined 
        JET_errIndexDuplicate = -1403, /// Index is already defined 
        JET_errIndexNotFound = -1404, /// No such index 
        JET_errIndexMustStay = -1405, /// Cannot delete clustered index 
        JET_errIndexInvalidDef = -1406, /// Illegal index definition 
        JET_errInvalidCreateIndex = -1409, /// Invalid create index description 
        JET_errTooManyOpenIndexes = -1410, /// Out of index description blocks 
        JET_errMultiValuedIndexViolation = -1411, /// Non-unique inter-record index keys generated for a multivalued index 
        JET_errIndexBuildCorrupted = -1412, /// Failed to build a secondary index that properly reflects primary index 
        JET_errPrimaryIndexCorrupted = -1413, /// Primary index is corrupt. The database must be defragmented 
        JET_errSecondaryIndexCorrupted = -1414, /// Secondary index is corrupt. The database must be defragmented 
        JET_wrnCorruptIndexDeleted = 1415, /// Out of date index removed 
        JET_errInvalidIndexId = -1416, /// Illegal index id 

        JET_errIndexTuplesSecondaryIndexOnly = -1430, /// tuple index can only be on a secondary index
        JET_errIndexTuplesTooManyColumns = -1431, /// tuple index may only have eleven columns in the index
        [Obsolete]
        JET_errIndexTuplesOneColumnOnly = JET_errIndexTuplesTooManyColumns, /// OBSOLETE 
        JET_errIndexTuplesNonUniqueOnly = -1432, /// tuple index must be a non-unique index
        JET_errIndexTuplesTextBinaryColumnsOnly = -1433, /// tuple index must be on a text/binary column
        [Obsolete]
        JET_errIndexTuplesTextColumnsOnly = JET_errIndexTuplesTextBinaryColumnsOnly, /// OBSOLETE 
        JET_errIndexTuplesVarSegMacNotAllowed = -1434, /// tuple index does not allow setting cbVarSegMac
        JET_errIndexTuplesInvalidLimits = -1435, /// invalid min/max tuple length or max characters to index specified
        JET_errIndexTuplesCannotRetrieveFromIndex = -1436, /// cannot call RetrieveColumn() with RetrieveFromIndex on a tuple index
        JET_errIndexTuplesKeyTooSmall = -1437, /// specified key does not meet minimum tuple length

        JET_errColumnLong = -1501, /// Column value is long 
        JET_errColumnNoChunk = -1502, /// No such chunk in long value 
        JET_errColumnDoesNotFit = -1503, /// Field will not fit in record 
        JET_errNullInvalid = -1504, /// Null not valid 
        JET_errColumnIndexed = -1505, /// Column indexed, cannot delete 
        JET_errColumnTooBig = -1506, /// Field length is greater than maximum 
        JET_errColumnNotFound = -1507, /// No such column 
        JET_errColumnDuplicate = -1508, /// Field is already defined 
        JET_errMultiValuedColumnMustBeTagged = -1509, /// Attempted to create a multi-valued column, but column was not Tagged 
        JET_errColumnRedundant = -1510, /// Second autoincrement or version column 
        JET_errInvalidColumnType = -1511, /// Invalid column data type 
        JET_wrnColumnMaxTruncated = 1512, /// Max length too big, truncated 
        JET_errTaggedNotNULL = -1514, /// No non-NULL tagged columns 
        JET_errNoCurrentIndex = -1515, /// Invalid w/o a current index 
        JET_errKeyIsMade = -1516, /// The key is completely made 
        JET_errBadColumnId = -1517, /// Column Id Incorrect 
        JET_errBadItagSequence = -1518, /// Bad itagSequence for tagged column 
        JET_errColumnInRelationship = -1519, /// Cannot delete, column participates in relationship 
        JET_wrnCopyLongValue = 1520, /// Single instance column bursted 
        JET_errCannotBeTagged = -1521, /// AutoIncrement and Version cannot be tagged 
        JET_errDefaultValueTooBig = -1524, /// Default value exceeds maximum size 
        JET_errMultiValuedDuplicate = -1525, /// Duplicate detected on a unique multi-valued column 
        JET_errLVCorrupted = -1526, /// Corruption encountered in long-value tree 
        JET_errMultiValuedDuplicateAfterTruncation = -1528, /// Duplicate detected on a unique multi-valued column after data was normalized, and normalizing truncated the data before comparison 
        JET_errDerivedColumnCorruption = -1529, /// Invalid column in derived table 
        JET_errInvalidPlaceholderColumn = -1530, /// Tried to convert column to a primary index placeholder, but column doesn't meet necessary criteria 
        JET_wrnColumnSkipped = 1531, /// Column value(s) not returned because the corresponding column id or itagSequence requested for enumeration was null 
        JET_wrnColumnNotLocal = 1532, /// Column value(s) not returned because they could not be reconstructed from the data at hand 
        JET_wrnColumnMoreTags = 1533, /// Column values exist that were not requested for enumeration 
        JET_wrnColumnTruncated = 1534, /// Column value truncated at the requested size limit during enumeration 
        JET_wrnColumnPresent = 1535, /// Column values exist but were not returned by request 
        JET_wrnColumnSingleValue = 1536, /// Column value returned in JET_COLUMNENUM as a result of JET_bitEnumerateCompressOutput 
        JET_wrnColumnDefault = 1537, /// Column value(s) not returned because they were set to their default value(s) and JET_bitEnumerateIgnoreDefault was specified 
        JET_errColumnCannotBeCompressed = -1538, /// Only JET_coltypLongText and JET_coltypLongBinary columns can be compressed 
        JET_wrnColumnNotInRecord = 1539, /// Column value(s) not returned because they could not be reconstructed from the data in the record 

        JET_errRecordNotFound = -1601, /// The key was not found 
        JET_errRecordNoCopy = -1602, /// No working buffer 
        JET_errNoCurrentRecord = -1603, /// Currency not on a record 
        JET_errRecordPrimaryChanged = -1604, /// Primary key may not change 
        JET_errKeyDuplicate = -1605, /// Illegal duplicate key 
        JET_errAlreadyPrepared = -1607, /// Attempted to update record when record update was already in progress 
        JET_errKeyNotMade = -1608, /// No call to JetMakeKey 
        JET_errUpdateNotPrepared = -1609, /// No call to JetPrepareUpdate 
        JET_wrnDataHasChanged = 1610, /// Data has changed 
        JET_errDataHasChanged = -1611, /// Data has changed, operation aborted 
        JET_wrnKeyChanged = 1618, /// Moved to new key 
        JET_errLanguageNotSupported = -1619, /// Windows installation does not support language 
        JET_errDecompressionFailed = -1620, /// Internal error: data could not be decompressed 

        JET_errTooManySorts = -1701, /// Too many sort processes 
        JET_errInvalidOnSort = -1702, /// Invalid operation on Sort 
        JET_errTempFileOpenError = -1803, /// Temp file could not be opened 
        JET_errTooManyAttachedDatabases = -1805, /// Too many open databases 
        JET_errDiskFull = -1808, /// No space left on disk 
        JET_errPermissionDenied = -1809, /// Permission denied 
        JET_errFileNotFound = -1811, /// File not found 
        JET_errFileInvalidType = -1812, /// Invalid file type 
        JET_wrnFileOpenReadOnly = 1813, /// Database file is read only 

        JET_errAfterInitialization = -1850, /// Cannot Restore after init. 
        JET_errLogCorrupted = -1852, /// Logs could not be interpreted 

        JET_errInvalidOperation = -1906, /// Invalid operation 
        JET_errAccessDenied = -1907, /// Access denied 
        JET_wrnIdleFull = 1908, /// Idle registry full 
        JET_errTooManySplits = -1909, /// Infinite split 
        JET_errSessionSharingViolation = -1910, /// Multiple threads are using the same session 
        JET_errEntryPointNotFound = -1911, /// An entry point in a DLL we require could not be found 
        JET_errSessionContextAlreadySet = -1912, /// Specified session already has a session context set 
        JET_errSessionContextNotSetByThisThread = -1913, /// Tried to reset session context, but current thread did not orignally set the session context 
        JET_errSessionInUse = -1914, /// Tried to terminate session in use 

        JET_errRecordFormatConversionFailed = -1915, /// Internal error during dynamic record format conversion 
        JET_errOneDatabasePerSession = -1916, /// Just one open user database per session is allowed (JET_paramOneDatabasePerSession) 
        JET_errRollbackError = -1917, /// error during rollback 

        JET_wrnDefragAlreadyRunning = 2000, /// Online defrag already running on specified database 
        JET_wrnDefragNotRunning = 2001, /// Online defrag not running on specified database 


        JET_wrnCallbackNotRegistered = 2100, /// Unregistered a non-existant callback function 
        JET_errCallbackFailed = -2101, /// A callback failed 
        JET_errCallbackNotResolved = -2102, /// A callback function could not be found 

        JET_errSpaceHintsInvalid = -2103, /// An element of the JET space hints structure was not correct or actionable. 

        JET_errOSSnapshotInvalidSequence = -2401, /// OS Shadow copy API used in an invalid sequence 
        JET_errOSSnapshotTimeOut = -2402, /// OS Shadow copy ended with time-out 
        JET_errOSSnapshotNotAllowed = -2403, /// OS Shadow copy not allowed (backup or recovery in progress) 
        JET_errOSSnapshotInvalidSnapId = -2404, /// invalid JET_OSSNAPID 

        JET_errLSCallbackNotSpecified = -3000, /// Attempted to use Local Storage without a callback function being specified 
        JET_errLSAlreadySet = -3001, /// Attempted to set Local Storage for an object which already had it set 
        JET_errLSNotSet = -3002, /// Attempted to retrieve Local Storage from an object which didn't have it set 

        //JET_errFileAccessDenied=-1032,
        //JET_errFileNotFound=-1811,
        //JET_errInvalidFilename=-1044,
        JET_errFileIOSparse = -4000, /// an I/O was issued to a location that was sparse 
        JET_errFileIOBeyondEOF = -4001, /// a read was issued to a location beyond EOF (writes will expand the file) 
        JET_errFileIOAbort = -4002, /// instructs the JET_ABORTRETRYFAILCALLBACK caller to abort the specified I/O 
        JET_errFileIORetry = -4003, /// instructs the JET_ABORTRETRYFAILCALLBACK caller to retry the specified I/O 
        JET_errFileIOFail = -4004, /// instructs the JET_ABORTRETRYFAILCALLBACK caller to fail the specified I/O 
        JET_errFileCompressed = -4005, /// read/write access is not supported on compressed files 
    }
}